
import {combineReducers} from 'redux'


function count(state={num:1,msg:"ji"},action){
       if(action.type==="add_todo"){
           return state.num+=action.data
       }
       return state;
}

function login(state={sid:""},action){
    console.log(action,"cunchu")
    if(action.type==="loginInfo"){
        return  Object.assign(state,action)
    }
    return state
}

//保存 基本的conf数据
const  conf=(state={},action)=>{
   if(action.type=="save_conf"){
       return Object.assign(state,action.conf)
   }
   return state
}

export default combineReducers({
    count,
    login,
    conf
})